package forward.Module.Modules.Misc;


import java.awt.Color;

import forward.api.EventHandler;
import forward.api.Events.World.EventPreUpdate;
import forward.Manager.ModuleManager;
import forward.Module.Module;
import forward.Module.ModuleType;
import forward.Util.MoveUtils;
import net.minecraft.client.Minecraft;

public class NoFall extends Module {
	public NoFall() {
		super("NoFall", new String[] { "Nofalldamage" }, ModuleType.Misc);
		this.setColor(new Color(242, 137, 73).getRGB());
	}

	@EventHandler
	private void onUpdate(EventPreUpdate e) {
		if (!MoveUtils.isOnGround((double) 1.0E-4) && Minecraft.thePlayer.motionY < 0.0&&this.mc.thePlayer.fallDistance > 2.0f) {
			e.setOnground(true);
		}
		/*
		 * if (this.mc.thePlayer.fallDistance > 3.0f) {
		 * this.mc.thePlayer.sendQueue.addToSendQueue(new
		 * C03PacketPlayer.C06PacketPlayerPosLook(this.mc.thePlayer.posX,
		 * this.mc.thePlayer.posY, this.mc.thePlayer.posZ,
		 * this.mc.thePlayer.rotationYaw, this.mc.thePlayer.rotationPitch, true));
		 * this.mc.thePlayer.fallDistance = 0.0f;
		 */

	}
}
